﻿using GameFramework;
using GameFramework.Event;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Assets.GameFramework.Scripts.Runtime.DailyTask
{
    public sealed class TaskRunEventArgs : GameEventArgs
    {

       public static readonly int EventId = typeof(TaskRunEventArgs).GetHashCode();

        public override int Id
        {
            get
            {
                return EventId;
            }
        }


        public int TaskId
        {
            get;
            private set;
        }

        public int CompletedCount
        {
            get;
            private set;
        }

        public TaskRunEventArgs()
        {
            TaskId = 0;
            CompletedCount = 0;
        }

        public static TaskRunEventArgs Create(int taskId, int completedCount)
        {
            TaskRunEventArgs taskRunEventArgs = ReferencePool.Acquire<TaskRunEventArgs>();
            taskRunEventArgs.TaskId = taskId;
            taskRunEventArgs.CompletedCount = completedCount;
            return taskRunEventArgs;
        }

        public override void Clear()
        {
            TaskId = 0;
            CompletedCount = 0;
        }
    }
}
